package com.bytz.modules.cms.product.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;

@Getter
@Setter
public class ProductDiscountCategoryDetail {

    @ApiModelProperty(value = "产品线")
    private String productLineName;

    @ApiModelProperty(value = "商品优惠分类名字")
    private String categoryName;

    @ApiModelProperty(value = "产品线等级ID")
    private String productLineLevelId;

    @ApiModelProperty(value = "产品线等级名称")
    private String productLineLevelName;

    @ApiModelProperty(value = "优惠比例")
    private BigDecimal discountRatio;

    @ApiModelProperty(value = "总优惠比例")
    private BigDecimal totalDiscountRatio;

    @ApiModelProperty(value = "等级优惠比例")
    private BigDecimal levelDiscountRatio;

    public BigDecimal getTotalDiscountRatio() {
        if (discountRatio != null && levelDiscountRatio != null) {
            return discountRatio.multiply(levelDiscountRatio);
        } else {
            return null;
        }
    }
}
